<template>
    <div>
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>首页</el-breadcrumb-item>
            <el-breadcrumb-item>权限管理</el-breadcrumb-item>
            <el-breadcrumb-item>菜单列表</el-breadcrumb-item>
        </el-breadcrumb>
        <el-card>
            <el-table :data="menulist" border stripe>
                <el-table-column type="index"></el-table-column>
                <el-table-column label="菜单名称" prop="name"></el-table-column>
                <el-table-column label="目标窗口" prop="target"></el-table-column>
                <el-table-column label="菜单等级" prop="level">
                    <template slot-scope="scope">
                        <el-tag type="success" v-if="scope.row.level === 0 ">一级菜单</el-tag>
                        <el-tag type="warning" v-else-if="scope.row.level === 1">二级菜单</el-tag>
                    </template>
                </el-table-column>

            </el-table>
        </el-card>
    </div>
</template>

<script>
export default{
    data(){
        return{
            menulist:[],
        }
    },
    created(){
        this.getmenulist()
    },
    methods:{
        async getmenulist(){
            
       const {data:res}=await this.$http.post('/sysMenu/getAllMenu')
       this.menulist=res
       console.log(this.menulist)

    }
        }
    
}
</script>

<style lang="less" scoped>

</style>